#!/bin/bash
#SQOOP_HOME=/opt/cloudera/parcels/CDH-6.2.1-1.cdh6.2.1.p0.1425774/bin/sqoop
SQOOP_HOME=/usr/bin/sqoop
if [[ $1 == "" ]];then
   TD_DATE=`date -d '1 days ago' "+%Y-%m-%d"`
else
   TD_DATE=$1
fi



sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table all_count \
--hcatalog-database zx_rpt \
--hcatalog-table all_count \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table dally_count \
--hcatalog-database zx_rpt \
--hcatalog-table dally_count \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table net_count \
--hcatalog-database zx_rpt \
--hcatalog-table net_count \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table origin_type \
--hcatalog-database zx_rpt \
--hcatalog-table origin_type \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table school_count \
--hcatalog-database zx_rpt \
--hcatalog-table school_count \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table subject_count \
--hcatalog-database zx_rpt \
--hcatalog-table subject_count \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table tdepart_name \
--hcatalog-database zx_rpt \
--hcatalog-table tdepart_name \
--input-fields-terminated-by '\t' \
-m 1
wait

sqoop export \
--connect "jdbc:mysql://192.168.88.80:3306/zx_rpt?
 useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table top_N \
--hcatalog-database zx_rpt \
--hcatalog-table top_n \
--input-fields-terminated-by '\t' \
-m 1
wait
